import { FMVCS } from "../../fgui/fmvc/FMVCS";
import ButtonTipsData from "./ButtonTipsData";
import { GlobalEvent } from "../global/Global";
import Manager from "../../manager/Manager";
import { ConstDefine } from "../common/ConstDefine";
import ButtonTipsView from "./ButtonTipsView";

export default class ButtonTipsCtrl extends FMVCS.FCtrl {
    /** 数据实体 */
    static data: ButtonTipsData = null;

    constructor() {
        super();
        ButtonTipsCtrl.data = new ButtonTipsData();
    }

    /** 事件监听注册 */
    rigisterEventListener(){
        this.on(GlobalEvent.UIListenID.UI_ButtonTipsView_Open, this.onOpenView, this);
    }

    onOpenView(data: ConstDefine.Tips.ButtonTipsEventData){
        ButtonTipsCtrl.data.setData(data);
        Manager.fui.open(ConstDefine.UI.ButtonTipsView, ButtonTipsView, ConstDefine.Common.UITransition.ScaleToBig);
    }
}
